<div class="piece1_bd">
	<div class="fl" style="width:340px;margin:0 10px;height:280px;position: relative;">
		<div class="piece_title" style="margin-left:0"></div>
		<div id="pic_tpk" class="pic_t_tj">
			<ul>
				<!--{loop $flash_list $topic}-->
				<li class="pic_t_tj_f">
					<a target="_blank" href="{$topic['url']}" class="pic_t_tj_f_box"><img scaleSrc="{getimg $topic['imgs'][0]['img'] 468 468}" src="./tpl/images/lazyload.gif" class="LOAD_SCALE_IMG" scaleType="3" scaleWidth="340" scaleHeight="185" /></a>
					<!--{getuser $topic['uid'] 0 '4' 'pic_author'}-->
					<div class="title ofh">
						<a class="topic_title tlink" target="_blank" href="{$topic['url']}">{cutstr $topic['title'] 40}</a>
						<a class="group_title glink" target="_blank" href="{u group/detail fid=$topic['fid']}">{cutstr $topic['group']['name'] 40}</a>
					</div>
				</li>
				<!--{/loop}-->
			</ul>
		</div>
		<div id="pic_tpk_btn" class="pic_tpk_btn">
			<div></div>
		</div>
	</div>
	<script type="text/javascript">
	jQuery(function($){
		$("#pic_tpk ul").carouFredSel({
			curcular: false,
			infinite: false,
			auto : true,
			pauseDuration:3000,
			pagination: "#pic_tpk_btn div",
			scroll: {
				pauseOnHover: true
			}
		});
	});
	</script>
	<div class="top-reco fr" style="width:580px;margin:0 10px">
		<div class="arr">
			<a class="c_arr aleft alstop"  href="javascript:;"></a>
			<a class="c_arr aright" href="javascript:;"></a>
		</div >
		<div id="new_topic_box">
		<ul class="reco_group">
			<!--{loop $best_pics $topic}-->
			<li>
				<a class="fr" href="{$topic['url']}" target="_blank"><img class="r5" src="{getimg $topic['imgs'][0]['img'] 100 100 1}" height="80" width="80"></a>
				<h3 class="rg_tt" ><a class="tlink" href="{$topic['url']}" target="_blank">{cutstr $topic['title'] 42}</a></h3>
				<p class="rg_con" >{cutstr $topic['content'] 26}</p>
				<p class="rg_gt"><a class="glink" href="{u group/detail fid=$topic['fid']}" target="_blank">{cutstr $topic['group']['name'] 20}</a></p>										
			</li>
			<!--{/loop}-->
		</ul>
		<ul class="reco_topic">
			<!--{loop $best_text $topic}-->
			<li>
				<!--{getuser $topic['uid'] 0 's,32' ',u_name fl r3'}-->
				<p class="rt_tt" ><a class="tlink" href="{$topic['url']}" target="_blank">{cutstr $topic['title'] 30}</a></p>
				<p class="rt_gt" ><a class="glink" href="{u group/detail fid=$topic['fid']}" target="_blank">{cutstr $topic['group']['name'] 30}</a></p>
			</li>
			<!--{/loop}-->
		</ul>
		</div>
	</div>
</div>
<script type="text/javascript">
var topTopicIndex = 1;
var maxTopTopicIndex = 6;
jQuery(function($){
	$('.aleft').click(function(){
		if(!$(this).hasClass('alstop'))
		{
			if(topTopicIndex <= 1)
				return;
			
			topTopicIndex--;
			getNewTopics();
		}
	});
	
	$('.aright').click(function(){
		if(!$(this).hasClass('arstop'))
		{
			if(topTopicIndex >= maxTopTopicIndex)
				return;
			
			topTopicIndex++;
			getNewTopics();
		}
	});
});

function getNewTopics()
{
	$.ajax({ 
		url: SITE_PATH+"services/service.php?m=topic&a=news",
		type: "POST",
		data:{"page":topTopicIndex},
		dataType: "json",
		success: function(result){
			if(result.status == 1 || result.status == 2)
			{
				$("#new_topic_box").html(result.html);
			}
			
			if(result.status > 1)
			{
				maxTopTopicIndex = topTopicIndex;
			}
			
			$(".c_arr").removeClass('alstop').removeClass('arstop');
			if(topTopicIndex >= maxTopTopicIndex)
			{
				topTopicIndex = maxTopTopicIndex;
				$(".aright").addClass('arstop');
			}
			else if(topTopicIndex <= 1)
			{
				topTopicIndex = 1;
				$(".aleft").addClass('alstop');
			}
		}
	});
}
</script>